package com.xt.LibaryDeskManager.dao;

import com.xt.LibaryDeskManager.dto.StudentDto;
import com.xt.LibaryDeskManager.dto.UserMessage;
import com.xt.LibaryDeskManager.vo.LoginVo;
import com.xt.LibaryDeskManager.vo.StudentVo;
import com.xt.LibaryDeskManager.vo.UpdateVo;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface StudentMapper {

    /**
     * 根据登录的信息查找用户
     * @param loginVo
     * @return
     */
    UserMessage selectByLoginVo(LoginVo loginVo)throws Exception;

    /**
     * 更新学生信息
     * @param updateVo
     * @return
     * @throws Exception
     */
    int updateStudent(UpdateVo updateVo)throws Exception;

    /**
     * 更新学生信息
     * @param studentVo
     * @return
     * @throws Exception
     */
    int updateStudent1(StudentVo studentVo)throws Exception;
    /**
     * 根据学号查找学生
     * @param id
     * @return
     * @throws Exception
     */
    UserMessage selectByNo(String id) throws Exception;

    /**
     * 添加学生
     * @param studentVo
     * @throws Exception
     */
    int addStudent(StudentVo studentVo)throws Exception;

    /**
     * 查找所有学生(统计使用)
     * @return
     * @throws Exception
     */
    List<UserMessage> selectAll1()throws Exception;

    /**
     * 查找所有学生个数
     * @return
     * @throws Exception
     */
    Integer getCount()throws Exception;
    /**
     * 查找所有学生(管理使用)
     * @return
     * @throws Exception
     */
    List<StudentDto> selectAll(StudentVo studentVo)throws Exception;

    /**
     * 修改学生状态
     * @param studentNo
     * @param valid
     * @return
     * @throws Exception
     */
    int updateValid(String studentNo, Boolean valid)throws Exception;

    /**
     * 删除学生信息
     * @param id
     * @return
     * @throws Exception
     */
    int deleteStudent(String id)throws Exception;
}
